package com.runen.infinitemovement.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.runen.infinitemovement.R;
import com.runen.infinitemovement.model.entity.MyMedalEntity;
import com.runen.infinitemovement.tool.GlideUtils;

/**
 * Create by LiaoDuanHong
 * Create on 2020/12/30 18:49
 */
class MyMedalItemAdapter extends BaseQuickAdapter<MyMedalEntity.DataBean.MedalsBean, BaseViewHolder> {
    private Context context;

    public MyMedalItemAdapter(Context context) {
        super(R.layout.item_my_medal_item);
        this.context = context;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, MyMedalEntity.DataBean.MedalsBean item) {
        ImageView ivMedal = helper.getView(R.id.iv_medal);
        TextView tvSportsTimes = helper.getView(R.id.tv_sports_times);
        GlideUtils.loadImage(context, item.iconUrl, ivMedal);
        tvSportsTimes.setText(item.name);
    }
}
